package triggerhelper.helperClasses;

import java.io.File;
import javax.swing.filechooser.*;

public class SimpleFileFilter extends FileFilter {

    private String ext, desc;

    public SimpleFileFilter(String ext_, String desc_){
        ext = ext_;
        desc = desc_;
    }

    public boolean accept(File f) {
        if (f.isDirectory()) {
            return true;
        }

        String extension = Utils.getExtension(f);
        if (extension != null) {
            if (extension.equals(ext)){
                return true;
            }else {
                return false;
            }
        }

        return false;
    }

    public String getDescription() {
        return desc;
    }
}
